//
//  AdsMix.h
//  PaintWar
//
//  Created by Tai Le on 10/8/14.
//
//

/*
     _adsMix = [[AdsMix alloc] initWithType:AdMixTypePeriod];
     //Period type
     AdItem *item1 = [[AdItem alloc] init];
     [item1 configureWithClass:[AdGADInterstitial class] period:60];

     AdItem *item2 = [[AdItem alloc] init];
     [item2 configureWithClass:[AdiAdInterstitial class] period:30];
     
     _adsMix = [[AdsMix alloc] initWithType:AdMixTypeWeight];
     //Weight type
     AdItem *item1 = [[AdItem alloc] init];
     [item1 configureWithClass:[AdGADInterstitial class] numberOfAllowFails:1];
     
     AdItem *item2 = [[AdItem alloc] init];
     [item2 configureWithClass:[AdiAdInterstitial class] numberOfAllowFails:1];
     
     [_adsMix configureAds:@[item1, item2]];
     _adsMix.delegate = self;
 
     - (void)adsMix:(AdsMix *)object didLoadAd:(BaseAds *)ad
     {
         NSLog(@"[%@] loaded content", ad.class);
         [ad showAdInterstitialInViewController:self];
     }
     
     - (void)adsMix:(AdsMix *)object didUnloadAdAndRestartRequest:(BaseAds *)ad
     {
     
     }
 */

#import <Foundation/Foundation.h>
#import "BaseAds.h"
#import "AdItem.h"

@protocol AdsMixDelegate;
@interface AdsMix : NSObject<BaseAdsDelegate>
{
    NSArray *_ads;
    AdMixType _type;
    NSInteger _curAdRequestIndex;
    BaseAds *_curAds;
}

@property (nonatomic, weak) id<AdsMixDelegate>delegate;

- (id)initWithType:(AdMixType)type;

//First in first priority. Array of AdItem object
- (void)configureAds:(NSArray *) adItems;
- (void)restartRequest;
- (BOOL)showAdInterstitialInViewController:(UIViewController *)controller;

@end

@protocol AdsMixDelegate <NSObject>

//ready to show ads
- (void)adsMix:(AdsMix *)object didLoadAd:(BaseAds *)ad;

//dissmiss ads
- (void)adsMix:(AdsMix *)object didUnloadAdAndRestartRequest:(BaseAds *)ad;

@end

